package aplicacion;

import gui.jtab.flower.JTabCirculos;
import gui.jtab.flower.JTabFlor;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import utils.files.FileManagerFlowers;
import aplicacion.frames.PantallaInicial;

public class App {

	public static App instanceApp;

	public App() {
		FileManagerFlowers.createResourceFolder();

		Vista vista = Vista.getInstance();
		JTabCirculos ciculos = new JTabCirculos(vista);
		JTabFlor flor = new JTabFlor(vista);
		vista.setCiculos(ciculos);
		vista.setFlor(flor);
		vista.run();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (ClassNotFoundException ex) {
		} catch (InstantiationException ex) {
		} catch (IllegalAccessException ex) {
		} catch (UnsupportedLookAndFeelException ex) {
		}
		PantallaInicial inicial = new PantallaInicial();
		inicial.setVisible(true);
		try {
			Thread.sleep(6000);
			inicial.setVisible(false);
			inicial.dispose();
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		App.getInstance();
	}

	public static synchronized App getInstance() {
		if (instanceApp == null) {
			instanceApp = new App();
		}
		return instanceApp;
	}

}
